<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @keyframes leftToRight {
            0%{
                thansform:translateX(-100%);
            }
            100%{
                transform:translateX(0);
            }
        }
        .come{
            animation:leftToRight 2s;
        }
        .go{
            animation:leftToRight 2s reverse;
        }
    </style>
</head>
<body>
    <div id="app"></div>
</body>
<script src="https://unpkg.com/vue@next"></script>
<script>
    const app=Vue.createApp({
        data(){
            return{
                isShow:true
            }
        
        },
        methods: {
            handleClick(){
                this.isShow=!this.isShow
            }
        },
        template:`
        <div>
            <div v-show="isShow" class="go">hello vue.js</div>
            <button @click="handleClick">切换</button>
            </div>`
    })
    app.mount("#app")
</script>
</html>